const util = require('../../../utils/util.js')
import { getInfo as memberInfo } from '../../../api/shareCenter'
const app = getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {
        balance:'0',
        dialogShow: false,
        memberInfo: {},
        showOneButtonDialog: false, 
    },
    
    toRecharege() {
        wx.navigateTo({
            url: '/pages/member/warehouse/recharge'
        })
    },
   
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        console.log(options,'optionsoptionsoptions')
     
        
        this.loadPromoter()
       
    },

    loadPromoter() {
        memberInfo().then(res => {
          this.data.balance = res.data.balance
          this.setData({
            balance: this.data.balance
          })
        })
      },
    
    /**z
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
      
        this.loadPromoter()
    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    toList(){
        wx.navigateTo({
            url: '/pages/member/warehouse/details',
        })
    },
 
})
